package Motor;

public class Luchador { 
	private ListaCartas list;
	private int pillz;
	
	Luchador(){
		setPillz(0);
		setList(new ListaCartas(2));
		getList().getList()[0]=null;
		getList().getList()[1]=null;
	}
	
	public void setPillz(int p){
		pillz=pillz+p;
	}
	
	public void setHero(Hero h){
		getList().getList()[0]=h.copiar();
	}
	
	public Hero getHero(){
		return (Hero) getList().getList()[0];
	}
	
	public void setHabilidad1(Habilidad h){
		getList().getList()[1]=h;
	}
	
	public void reset(){
		getList().getList()[0]=null;
		getList().getList()[1]=null;
		pillz=0;
	}

	public ListaCartas getList() {
		return list;
	}

	public void setList(ListaCartas list) {
		this.list = list;
	}

	public int getPillz() {
		return pillz;
	}

	public Luchador copiar() {
		// TODO Auto-generated method stub
		Luchador aux=new Luchador();
		aux.pillz=this.pillz;
		aux.list=this.list.copiar();
		return aux;
	}

	public String mostrar() {
		// TODO Auto-generated method stub
		String s="[Hero: ";
		try{
			s+=list.verCarta(0).mostrar();
		}catch(Exception e){
			s+="null";
		}
		s+=", Equipo: ";
		try{
			s+=((Hero)list.verCarta(0)).getEquipo().mostrar();
		}catch(Exception e){
			s+="null";
		}
		s+=", Hab: ";
		try{
			s+=list.verCarta(1).mostrar();
		}catch(Exception e){
			s+="null";
		}
		s+=", Pillz: "+pillz+"]";
		return s;
	}
	
	

}
